package cn.wildfire.chat.app.main;

import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebViewClient;

import com.sourcemuch.im.caiba.R;import com.sourcemuch.im.caiba.R2;

import butterknife.BindView;
import cn.wildfire.chat.app.extendsion.https.ServerUrlClient;
import cn.wildfire.chat.kit.WfcBaseActivity;

/**
 * @Author LiZhong
 * @Date 2019/9/9
 * 用户协议界面
 */
public class UserAgrementActiviy extends WfcBaseActivity {

    @BindView(R2.id.wv_privacy)
    WebView wvPrivacy;

    @Override
    protected int contentLayout() {
        return R.layout.activity_privacy_policy;
    }

    @Override
    protected void setTitleCenterThenSetSearchView() {
        super.setTitleCenterThenSetSearchView();
        setToolbarOrReplaceType(true, 3);
        setReplaceTitle(getString(R.string.text_user_agreement), -1);
        setSearchLayoutVisibility(false);
        try {
            // 设置页面字体显示
            WebSettings settings = wvPrivacy.getSettings();
            settings.setUseWideViewPort(true);
            settings.setLoadWithOverviewMode(true);
            settings.setSupportZoom(true);
            settings.setDisplayZoomControls(false);
            settings.setTextZoom(200);
            //添加WebViewClient实例
            wvPrivacy.setWebViewClient(new WebViewClient());
            //添加浏览器地址
            wvPrivacy.loadUrl(ServerUrlClient.USER_AGREEMENT);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}
